package others;

class Solution {
    public int[] twoSum(int[] nums, int target) {
        int[] tmp = {0,1};
        return tmp;
    }

    // main方法中的内容就相当于是测试用例的代码,到时候与用户提交的核心代码进行拼接就行
    public static void main(String[] args) {
        Solution solution = new Solution();
        // 测试用例可以参考详情页的输入输出测试
        // testCase1
        int[] nums = {2,7,11,15};
        int target = 9;
        int[] result = solution.twoSum(nums,target);
        // 检测运行结果，看与预期是否相符
        if(result.length==2 && result[0]==0 && result[1]==1) {
            System.out.println("testCase1 OK");
        } else {
            System.out.println("testCase1 failed");
        }
        // testCase2
        int[] nums2 = {3,2,4};
        int target2 = 6;
        int[] result2 = solution.twoSum(nums2,target2);
        // 检测运行结果，看与预期是否相符
        if(result2.length==2 && result2[0]==1 && result2[1]==2) {
            System.out.println("testCase2 OK");
        } else {
            System.out.println("testCase2 failed");
        }
        // testCase3
        int[] nums3 = {3,3};
        int target3 = 6;
        int[] result3 = solution.twoSum(nums3,target3);
        // 检测运行结果，看与预期是否相符
        if(result3.length==2 && result3[0]==0 && result3[1]==1) {
            System.out.println("testCase3 OK");
        } else {
            System.out.println("testCase3 failed");
        }
    }
}